<div ng-controller="balanceListCtrl">
    <div class="table-header clearfix ng-scope">
        <span class="fl lh30 f14">合同返款</span>
    </div>
    <div>
        <my-nav data-nav-items="filterDataStatus" onchanged="changeStatus" data-title="返款状态:"></my-nav>
        <my-nav data-nav-items="filterDataNature" onchanged="changeNature" data-title="合同性质:"></my-nav>
        <my-nav data-nav-items="filterDataCities" onchanged="changeCity" data-title="城市区域:"
                data-text-field="name"></my-nav>
    </div>
    <div class="section-table mt20">
        <div class="table-header lh30 pb5 clearfix">
            <span class="fl f14">合同列表</span>

            <div class="fr btn-group">
                <span class="fl">返款日期：</span>

                <input type="text" class="fl input-text w120 ml3 input-date" ng-model="query.beginDate"
                       ng-enter="query.execute()" ui-date format="yyyy-MM-dd">
                <span class="fl ml3">-</span>
                <input type="text" class="fl input-text w120 ml3 input-date" ng-model="query.endDate"
                       ng-enter="query.execute()" ui-date format="yyyy-MM-dd">
                <input type="text" class="fl input-text w200 ml3" placeholder="公司/合同编号/客户全称" ng-model="query.keyword"
                       ng-enter="query.execute()">
                <button class="btn" ng-click="query.execute()">查询</button>
                <div id="importBalance" class="fileinput-button btn btn-yellow">
                    <span class="f13">导入返款状态</span>
                    <input type="file" name="file" accept=".xls*">
                </div>
                <button class="btn btn-yellow" ng-click="export()" title="导出未返款合同">导出</button>
            </div>
        </div>
        <div class="table-wrap mh500 mt10">
            <table class="table">
                <thead>
                <tr>
                    <th style="width: 40px;text-align: center;">序号</th>
                    <th style="width: 180px;">客户信息</th>
                    <th style="width: 200px;">合同信息</th>
                    <th style="width: 170px;">合同签署公司</th>
                    <th style="width: 150px;">签约信息</th>
                    <th style="width: 130px;">签约金额</th>
                    <th>返款信息</th>
                </tr>
                </thead>
                <tbody>
                <tr ng-repeat="record in contracts" class="table-tr">
                    <td style="text-align: center"><p ng-bind="$index + 1 + startPageIndex"></p></td>
                    <td>
                        <p ng-bind="record.customer_name"></p>

                        <p class="c9">客户简称：{{record.customer_full_name}}</p>
                    </td>
                    <td>
                        <p ng-bind="record.contract_code"></p>

                        <p class="c9">合同性质：{{record.property_name}}</p>

                        <p class="c9">合同类别：{{record.category_name}}</p>

                        <p class="c9">租期：{{record.beginOn | strdate:'yyyy-MM-dd'}}至{{record.endOn | strdate:'yyyy-MM-dd'}}</p>
                    </td>
                    <td>
                        <p ng-bind="record.company_name"></p>

                        <p class="c9">所属区域：{{record.area_name}}</p>
                    </td>
                    <td>
                        <p>签约人：{{record.user_name}}</p>

                        <p class="c9">签约日期：{{record.sign_date | strdate:'yyyy-MM-dd'}}</p>
                    </td>
                    <td>
                        <p>签约金额：{{record.sign_amount | number:2}}</p>

                        <p class="c9">租用金额：{{record.rent_amount | number:2}}</p>

                        <p class="c9">交付金额：{{record.delivery_amount | number:2}}</p>
                    </td>
                    <td>
                        <p ng-if="record.balance_status==1">已返款</p>
                        <p ng-if="record.balance_status!=1">未返款</p>

                        <p>返款金额：{{record.balance_amount | number:2}}</p>

                        <p class="c9">返款金额：{{record.back_amount | number:2}}</p>

                        <p class="c9">返款日期：{{record.repayment_time | strdate:'yyyy-MM-dd'}}</p>
                    </td>
                </tr>
                </tbody>
            </table>
            <div class="no-data" ng-if="contracts.length==0"><span>暂无数据</span></div>
        </div>
        <div id="pagination" class="pagination"></div>
    </div>
</div>
